import Ember from 'ember';
import BaseBusiness from '../base-business';
import Pagination from '../pagination';
const { taskStatus_begin,taskStatus_isPassed,taskApplyStatus_apply,taskApplyStatus_applySuc,taskApplyStatus_applyFail,taskApplyStatus_invited,taskApplyStatus_SuccNotLocateSeat,taskApplyStatus_refuseInvitation} = Constants;

export default BaseBusiness.extend(Pagination,{
  pageyModelListName: "content",
  feedService: Ember.inject.service('feed-bus'),
  header_title: "任务列表",

  model() {
    return {};
  },
  setupController(controller, model){
    var _self = this;
    this._super(controller, model);
    //设置初始值
    var servicsData = [{
      id:1,
      icon:"assets/images/avatars/old3.jpg",
      title:"翻身任务",
      nameTest:"刘立娜|05床",
      text1:"翻身",
      text2:"喂饭",
      text3:"活动筋骨",
      text4:"听音乐",
      roomName:"刘立娜",
      room:"A301-5床",
      label:"09:00",
      txt1:"详情：翻完身聊聊天，活动活动",
      status:0,
    },{
      id:2,
      icon:"assets/images/avatars/3379861_122508002258_2.jpg",
      title:"聊聊家常",
      nameTest:"刘立娜|05床",
      text1:"聊天",
      text2:"散步",
      text3:"听音乐",
      text4:"活动筋骨",
      roomName:"刘立娜",
      room:"A301-5床",
      label:"10:00",
      txt1:"详情：翻完身聊聊天，活动活动",
      status:0,
    },{
      id:3,
      icon:"assets/images/avatars/3379861_122508002258_2.jpg",
      title:"上午喂药",
      nameTest:"王贵福|06床",
      text1:"聊天",
      text2:"散步",
      text3:"听音乐",
      text4:"活动筋骨",
      roomName:"王贵福",
      room:"A301-6床",
      label:"11:00",
      txt1:"详情：翻完身聊聊天，活动活动",
      status:0,
    },{
      id:4,
      icon:"assets/images/avatars/3379861_122508002258_2.jpg",
      title:"活动筋骨",
      nameTest:"王贵福|06床",
      text1:"聊天",
      text2:"散步",
      text3:"听音乐",
      text4:"活动筋骨",
      roomName:"王贵福",
      room:"A301-6床",
      label:"12:00",
      txt1:"详情：翻完身聊聊天，活动活动",
      status:0,
    },{
      id:5,
      icon:"assets/images/avatars/3379861_122508002258_2.jpg",
      title:"活动筋骨",
      nameTest:"王成|07床",
      text1:"聊天",
      text2:"散步",
      text3:"听音乐",
      text4:"活动筋骨",
      roomName:"王成",
      room:"A301-7床",
      label:"12:00",
      txt1:"详情：翻完身聊聊天，活动活动",
      status:0,
    },];
    var arr = Ember.A();
    servicsData.forEach(function(item){
      var ent = Ember.Object.create(item);
      arr.pushObject(ent);
    });
    var taskList = arr;//Ember.ArrayProxy.create({ content: Ember.A(servicsData)});
    controller.set("taskList",taskList);
    controller.set("csData",this.initCustomerServiceData());
    controller.refreshTabNumber();
  },

  initCustomerServiceData:function(){
    var c1 = Ember.Object.create({
      id:1,
      name:'刘立娜',
      room:'A301-5床',
      staffName: '护工一',
      services:new Ember.A([Ember.Object.create({
        id:1,
        name:'翻身',
        cnt:1,
        detail:new Ember.A([{
          content:"翻身时长为5分钟，客户没有不良反应(11:20)"
        },{
          content:"翻身时长为3分钟，客户没有不良反应(15:20)"
        }]),
      }),Ember.Object.create({
        id:2,
        name:'喂药',
        cnt:2,
        detail:new Ember.A([{
          content:"xx药品，喂了3粒，顺利完成(13:20)"
        }]),
      }),Ember.Object.create({
        id:3,
        name:'上厕所',
        cnt:1
      })]),
    });
    var c2 = Ember.Object.create({
      id:2,
      name:'王贵福',
      room:'A301-6床',
      staffName: '护工一',
      services:new Ember.A([Ember.Object.create({
        id:4,
        name:'翻身',
        cnt:1
      }),Ember.Object.create({
        id:5,
        name:'喂药',
        cnt:2
      }),Ember.Object.create({
        id:6,
        name:'上厕所',
        cnt:1
      })]),
    });
    return new Ember.A([c1,c2]);
  }
});
